#define _XOPEN_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

int main(void)
{
	struct tm tm;
	char buf[255];
	time_t tsec;

	memset(&tm, 0, sizeof(struct tm));
	//strptime("2001-11-12 18:31:01", "%Y-%m-%d %H:%M:%S", &tm);
	strptime("2019-11-19 15:30:00", "%Y-%m-%d %H:%M:%S", &tm);
	printf("tsec = %ld,now = %ld\n",mktime(&tm),time(NULL));
	strftime(buf, sizeof(buf), "%d %b %Y %H:%M", &tm);
	puts(buf);
	exit(EXIT_SUCCESS);
}

